# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1046.1.327+1.1046.383.7 -> 1.1046.1.328
#	      kernel/ksyms.c	1.203.1.5 -> 1.207  
#	arch/ppc64/kernel/entry.S	1.26.1.1 -> 1.29   
#	include/asm-mips/unistd.h	1.6.1.1 -> 1.9    
#	  include/linux/mm.h	1.121.1.3 -> 1.123  
#	drivers/serial/8250.c	1.33.1.1 -> 1.35   
#	include/asm-ppc64/processor.h	1.30.1.1 -> 1.32   
#	include/linux/sched.h	1.151.1.4 -> 1.155  
#	       kernel/fork.c	1.124.1.6 -> 1.127  
#	     kernel/sysctl.c	1.46.1.1 -> 1.48   
#	        kernel/sys.c	1.43.1.6 -> 1.46   
#	arch/i386/kernel/traps.c	1.52.1.3 -> 1.55   
#	arch/i386/kernel/Makefile	1.44.1.1 -> 1.46   
#	include/asm-ppc/thread_info.h	1.7.1.2 -> 1.10   
#	    kernel/softirq.c	1.39.1.4 -> 1.42   
#	drivers/acpi/pci_root.c	1.13.1.3 -> 1.17   
#	include/linux/nfs_fs.h	1.45.1.1 -> 1.47   
#	include/linux/pci_ids.h	1.103.1.4 -> 1.106  
#	 include/linux/pci.h	1.90.1.9 -> 1.93   
#	include/linux/sunrpc/svc.h	1.20.1.4 -> 1.25   
#	arch/ppc64/mm/init.c	1.46.1.1 -> 1.49   
#	      fs/proc/base.c	1.42.1.10 -> 1.48   
#	           mm/mmap.c	1.85.1.3 -> 1.87   
#	include/asm-i386/unistd.h	1.25.1.2 -> 1.28   
#	            Makefile	1.410.3.2 -> 1.414  
#	include/asm-x86_64/unistd.h	1.14.1.1 -> 1.17   
#	arch/ppc64/mm/numa.c	1.7.1.1 -> 1.9    
#	arch/ppc64/kernel/sys_ppc32.c	1.58.4.2 -> 1.58.1.8
#	arch/ppc64/kernel/prom.c	1.28.1.1 -> 1.31   
#	     kernel/module.c	1.86.1.1 -> 1.88   
#	include/asm-x86_64/pgtable.h	1.21.1.1 -> 1.23   
#	arch/ppc64/kernel/smp.c	1.38.1.1 -> 1.38.1.2
#	net/ipv4/tcp_input.c	1.39.1.2 -> 1.41   
#	      kernel/sched.c	1.193.1.8 -> 1.196  
#	  drivers/acpi/osl.c	1.37.1.3 -> 1.41   
#	include/asm-mips64/unistd.h	1.5.1.1 -> 1.8    
#	      kernel/timer.c	1.59.1.3 -> 1.62   
#	arch/ppc64/xmon/xmon.c	1.26.1.1 -> 1.29   
#	arch/ppc64/kernel/pci.c	1.33.1.1 -> 1.36   
#	include/asm-sh/unistd.h	1.5.1.1 -> 1.8    
#	arch/s390/kernel/module.c	1.8.1.1 -> 1.10   
#	arch/x86_64/kernel/module.c	1.9.1.1 -> 1.11   
#	drivers/serial/Kconfig	1.8.1.4 -> 1.13   
#	    net/sunrpc/svc.c	1.21.1.1 -> 1.23   
#	include/linux/irq_cpustat.h	1.7.1.3 -> 1.10   
#	include/asm-ppc64/mmzone.h	1.11.1.1 -> 1.13   
#	     kernel/printk.c	1.25.1.1 -> 1.28   
#	drivers/scsi/sym53c8xx_2/sym_glue.c	1.23.1.3 -> 1.25   
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Mon Sep 22 13:01:41 2003
+++ b/Makefile	Mon Sep 22 13:01:41 2003
@@ -213,7 +213,7 @@
 NOSTDINC_FLAGS  = -nostdinc -iwithprefix include
 
 CPPFLAGS	:= -D__KERNEL__ -Iinclude
-CFLAGS 		:= $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS 		:= $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -g -O2 \
 	  	   -fno-strict-aliasing -fno-common
 AFLAGS		:= -D__ASSEMBLY__ $(CPPFLAGS)
 
diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
--- a/arch/ppc64/kernel/sys_ppc32.c	Mon Sep 22 13:01:41 2003
+++ b/arch/ppc64/kernel/sys_ppc32.c	Mon Sep 22 13:01:41 2003
@@ -1147,7 +1147,7 @@
 	u32 totalhigh;
 	u32 freehigh;
 	u32 mem_unit;
-	char _f[20-2*sizeof(long)-sizeof(int)];
+	char _f[20-2*sizeof(int)-sizeof(int)];
 };
 
 extern asmlinkage long sys_sysinfo(struct sysinfo *info);
diff -Nru a/drivers/serial/8250.c b/drivers/serial/8250.c
--- a/drivers/serial/8250.c	Mon Sep 22 13:01:41 2003
+++ b/drivers/serial/8250.c	Mon Sep 22 13:01:41 2003
@@ -122,13 +122,13 @@
 	struct uart_port	port;
 	struct timer_list	timer;		/* "no irq" timer */
 	struct list_head	list;		/* ports on this IRQ */
+	unsigned short		rev;
 	unsigned char		acr;
 	unsigned char		ier;
-	unsigned char		rev;
 	unsigned char		lcr;
 	unsigned char		mcr_mask;	/* mask of user bits */
 	unsigned char		mcr_force;	/* mask of forced bits */
-	unsigned int		lsr_break_flag;
+	unsigned char		lsr_break_flag;
 
 	/*
 	 * We provide a per-port pm hook.
diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
--- a/include/linux/nfs_fs.h	Mon Sep 22 13:01:41 2003
+++ b/include/linux/nfs_fs.h	Mon Sep 22 13:01:41 2003
@@ -408,7 +408,7 @@
 nfs_size_to_loff_t(__u64 size)
 {
 	loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1;
-	if (size > maxsz)
+	if (size > (__u64) maxsz)
 		return maxsz;
 	return (loff_t) size;
 }
diff -Nru a/include/linux/sched.h b/include/linux/sched.h
--- a/include/linux/sched.h	Mon Sep 22 13:01:41 2003
+++ b/include/linux/sched.h	Mon Sep 22 13:01:41 2003
@@ -517,9 +517,10 @@
  */
 extern struct exec_domain	default_exec_domain;
 
-#ifndef INIT_THREAD_SIZE
-# define INIT_THREAD_SIZE	2048*sizeof(long)
-#endif
+#ifndef __HAVE_ARCH_TASK_STRUCT_ALLOCATOR
+# ifndef INIT_THREAD_SIZE
+#  define INIT_THREAD_SIZE	2048*sizeof(long)
+# endif
 
 union thread_union {
 	struct thread_info thread_info;
@@ -527,6 +528,9 @@
 };
 
 extern union thread_union init_thread_union;
+
+#endif /* !__HAVE_ARCH_TASK_STRUCT_ALLOCATOR */
+
 extern struct task_struct init_task;
 
 extern struct   mm_struct init_mm;
diff -Nru a/kernel/printk.c b/kernel/printk.c
--- a/kernel/printk.c	Mon Sep 22 13:01:41 2003
+++ b/kernel/printk.c	Mon Sep 22 13:01:41 2003
@@ -313,6 +313,12 @@
 			__call_console_drivers(start, end);
 		}
 	}
+#ifdef CONFIG_IA64_EARLY_PRINTK
+	if (!console_drivers) {
+		void early_printk (const char *str, size_t len);
+		early_printk(&LOG_BUF(start), end - start);
+	}
+#endif
 }
 
 /*
@@ -630,7 +636,11 @@
 		 * for us.
 		 */
 		spin_lock_irqsave(&logbuf_lock, flags);
+#ifdef CONFIG_IA64_EARLY_PRINTK
+		con_start = log_end;
+#else
 		con_start = log_start;
+#endif
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 	}
 	release_console_sem();
@@ -683,3 +693,117 @@
 		tty->driver->write(tty, 0, msg, strlen(msg));
 	return;
 }
+
+#ifdef CONFIG_IA64_EARLY_PRINTK
+
+#include <asm/io.h>
+
+# ifdef CONFIG_IA64_EARLY_PRINTK_VGA
+
+
+#define VGABASE		((char *)0xc0000000000b8000)
+#define VGALINES	24
+#define VGACOLS		80
+
+static int current_ypos = VGALINES, current_xpos = 0;
+
+static void
+early_printk_vga (const char *str, size_t len)
+{
+	char c;
+	int  i, k, j;
+
+	while (len-- > 0) {
+		c = *str++;
+		if (current_ypos >= VGALINES) {
+			/* scroll 1 line up */
+			for (k = 1, j = 0; k < VGALINES; k++, j++) {
+				for (i = 0; i < VGACOLS; i++) {
+					writew(readw(VGABASE + 2*(VGACOLS*k + i)),
+					       VGABASE + 2*(VGACOLS*j + i));
+				}
+			}
+			for (i = 0; i < VGACOLS; i++) {
+				writew(0x720, VGABASE + 2*(VGACOLS*j + i));
+			}
+			current_ypos = VGALINES-1;
+		}
+		if (c == '\n') {
+			current_xpos = 0;
+			current_ypos++;
+		} else if (c != '\r')  {
+			writew(((0x7 << 8) | (unsigned short) c),
+			       VGABASE + 2*(VGACOLS*current_ypos + current_xpos++));
+			if (current_xpos >= VGACOLS) {
+				current_xpos = 0;
+				current_ypos++;
+			}
+		}
+	}
+}
+
+# endif /* CONFIG_IA64_EARLY_PRINTK_VGA */
+
+# ifdef CONFIG_IA64_EARLY_PRINTK_UART
+
+#include <linux/serial_reg.h>
+#include <asm/system.h>
+
+static void early_printk_uart(const char *str, size_t len)
+{
+	static char *uart = NULL;
+	unsigned long uart_base;
+	char c;
+
+	if (!uart) {
+		uart_base = 0;
+#  ifdef CONFIG_SERIAL_8250_HCDP
+		{
+			extern unsigned long hcdp_early_uart(void);
+			uart_base = hcdp_early_uart();
+		}
+#  endif
+#  if CONFIG_IA64_EARLY_PRINTK_UART_BASE
+		if (!uart_base)
+			uart_base = CONFIG_IA64_EARLY_PRINTK_UART_BASE;
+#  endif
+		if (!uart_base)
+			return;
+
+		uart = ioremap(uart_base, 64);
+		if (!uart)
+			return;
+	}
+
+	while (len-- > 0) {
+		c = *str++;
+		while ((readb(uart + UART_LSR) & UART_LSR_TEMT) == 0)
+			cpu_relax(); /* spin */
+
+		writeb(c, uart + UART_TX);
+
+		if (c == '\n')
+			writeb('\r', uart + UART_TX);
+	}
+}
+
+# endif /* CONFIG_IA64_EARLY_PRINTK_UART */
+
+#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN
+extern int sn_sal_console_out(const char *str, int len);
+#endif
+
+void early_printk(const char *str, size_t len)
+{
+#ifdef CONFIG_IA64_EARLY_PRINTK_UART
+	early_printk_uart(str, len);
+#endif
+#ifdef CONFIG_IA64_EARLY_PRINTK_VGA
+	early_printk_vga(str, len);
+#endif
+#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN
+ 	sn_sal_console_out(str, len);
+#endif
+}
+
+#endif /* CONFIG_IA64_EARLY_PRINTK */
diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c
--- a/kernel/sysctl.c	Mon Sep 22 13:01:41 2003
+++ b/kernel/sysctl.c	Mon Sep 22 13:01:41 2003
@@ -551,6 +551,16 @@
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
+#ifdef CONFIG_SMP
+	{
+		.ctl_name	= KERN_CACHEDECAYTICKS,
+		.procname	= "cache_decay_ticks",
+		.data		= &cache_decay_ticks,
+		.maxlen		= sizeof(cache_decay_ticks),
+		.mode		= 0644,
+		.proc_handler	= &proc_doulongvec_minmax,
+	},
+#endif
 	{ .ctl_name = 0 }
 };